import 'package:get/get.dart';
import 'package:getx_mvvm_lite/core/state/page_state.dart';

abstract class BaseViewModel extends GetxController {
  final Rx<PageState> pageState = PageState.initial().obs;

  void setLoading() => pageState.value = PageState.loading();
  void setContent() => pageState.value = PageState.content();
  void setEmpty([String? msg]) => pageState.value = PageState.empty(msg);
  void setError([String? msg]) => pageState.value = PageState.error(msg);

  Future<void> refresh();
}